package biz.obake.team.touchprotector.f;

import android.graphics.drawable.Drawable;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.f.l;
import biz.obake.team.touchprotector.lfd.f;
import d.e;
import d.h.b.c;

public final class g implements l {

    /* renamed from: b  reason: collision with root package name */
    private final ImageView f1621b;

    public g(k kVar) {
        c.c(kVar, "protectorView");
        View findViewById = kVar.findViewById(R.id.imageView);
        if (findViewById != null) {
            this.f1621b = (ImageView) findViewById;
            return;
        }
        throw new e("null cannot be cast to non-null type android.widget.ImageView");
    }

    public void a() {
        l.a.c(this);
    }

    public boolean b(MotionEvent motionEvent) {
        c.c(motionEvent, "event");
        return l.a.a(this, motionEvent);
    }

    public void c() {
        f d2 = f.d();
        c.b(d2, "LfdState.getInstance()");
        Drawable c2 = d2.c();
        this.f1621b.setImageDrawable(c2);
        if (c2 != null) {
            ImageView imageView = this.f1621b;
            String simpleName = c2.getClass().getSimpleName();
            imageView.setScaleType((simpleName != null && simpleName.hashCode() == 1124812116 && simpleName.equals("NinePatchDrawable")) ? ImageView.ScaleType.FIT_XY : ImageView.ScaleType.CENTER_CROP);
        }
        this.f1621b.invalidate();
    }

    public void d() {
        l.a.b(this);
    }
}
